﻿using VSTranslator.Translation;

namespace VSTranslator.Settings
{
	class Options
	{
		public BaseTranslator Translator { get; set; }
		public string SourceLanguage { get; set; }
		public string TargetLanguage { get; set; }

		private Options()
		{ }

		public static Options Get()
		{
			var customOptions = Global.DTE.Properties["Translator", "Options"];
			Options res = new Options 
			{ 
				Translator = TranslatorRegistry.GetTranslator((string)customOptions.Item("TranslationService").Value),
				SourceLanguage = (string)customOptions.Item("SourceLanguage").Value,
				TargetLanguage = (string)customOptions.Item("TargetLanguage").Value
			};			
			return res;
		}
	}
}
